module.exports = {
    //加密的方法
    hmc(pwd){
        const crypto = require('crypto');

        const secret = 'abcdefg';
        const hash = crypto.createHmac('sha256', secret)
                        .update(pwd)
                        .digest('hex');
        console.log(hash);
        return hash
    },
    format(){
        let score_time = new Date();
        let y = score_time.getFullYear();
        let m = score_time.getMonth()+1;
        let d = score_time.getDate();
        return `${y}-${m}-${d}`
    }
}